<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>参数解构</title>
</head>
<body>
    <script>
        // function show1(person){
        //     console.log(person.name , person.age)
        // }

        function show2({name,age,show}){
            show(name,age)
        }

        const stu = {
            name:'jack',
            age:19,
            show:function (name,age){
                console.log('我是学生',name,age);
            }
        }

        const teacher = {
            name:'王老师',
            age:46,
            show:function (name,age){
                console.log('我是老师',name,age);
                console.log('上课了')
            }
        }

        // show1(stu)
        show2(stu)
        show2(teacher)
    </script>
</body>
</html>